package day7;

public class Bird {
     int wins;
     int legs;
}

class Sparrow extends Bird{
    int age;
    double heavy;

    public void spar(){
        System.out.println("麻雀的翅膀数量为："+wins+"，腿的数量为："+legs+"，年龄为："+age+"岁,重量为："+heavy+"kg");
    }

}

class Ostrich extends Bird{
    double height;
    double speed;
    public void ost(){
        System.out.println("鸵鸟的翅膀数量为："+wins+"，腿的数量为："+legs+"，高度为："+height+"米,奔跑速度为："+speed);
    }
}

class Eagle extends Bird{
    String eat;
    double flyHeight;
    public void eag(){
        System.out.println("鹰的翅膀数量为："+wins+"，腿的数量为："+legs+"，捕食对象为："+eat+",飞行高度为："+flyHeight+"米");
    }
}

class TestBird{
    public static void main(String[] args) {
        Sparrow s=new Sparrow();
        s.wins=2; s.legs=2; s.age=1; s.heavy=0.2;
        s.spar();
        Ostrich o=new Ostrich();
        o.wins=2; o.legs=2; o.height=1.5; o.speed=40;
        o.ost();
        Eagle e=new Eagle();
        e.wins=2; e.legs=2; e.eat="兔子"; e.flyHeight=800;
        e.eag();
    }
}